package com.example.controller;

import com.example.framwork.code.CodeConst;
import com.example.framwork.result.ProjectResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/account")
public class AccountController {


  //  private final AccountService accountService;
    @RequestMapping(value = "/getAcc", method = {RequestMethod.GET, RequestMethod.POST})
    public ProjectResult hello() {

        return new ProjectResult(CodeConst.SUCCESS, "this is ok", null);
    }


    /*
    @GetMapping
    public ProjectResult get(@RequestParam String key, @RequestParam Integer num) {
        if (StringUtils.isEmpty(num) || num == 0) {
            num = 10;
        }
        List<Account> listacc = accountService.selectList(new EntityWrapper<Account>()
                .like(!StringUtils.isEmpty(key), "logon_name", key)
                .orderBy(!StringUtils.isEmpty(key), "length(logon_name)").last("limit " + num)
        );
        List<Accountres> listres = new ArrayList<>();
        if (!CollectionUtils.isEmpty(listacc)) {
            for (Account acc : listacc) {
                Accountres res = new Accountres();
                res.setAccNo(acc.getAccNo());
                res.setLogonName(acc.getLogonName());
                res.setTrueName(acc.getTrueName());
                listres.add(res);
            }
        }
        return new ProjectResult(CodeConst.SUCCESS, "com_search_success", listres);
    }
     */
}
